

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Logging &mdash; PackNet-SfM 1.0 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Saving" href="utils.save.html" />
    <link rel="prev" title="Reduce" href="utils.reduce.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html">
          

          
            
            <img src="../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../configs/configs.html">Configs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../scripts/scripts.html">Scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trainers/trainers.html">Trainers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../datasets/datasets.html">Datasets</a></li>
<li class="toctree-l1"><a class="reference internal" href="../models/models.html">Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="../networks/networks.html">Networks</a></li>
<li class="toctree-l1"><a class="reference internal" href="../losses/losses.html">Losses</a></li>
<li class="toctree-l1"><a class="reference internal" href="../loggers/loggers.html">Loggers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../geometry/geometry.html">Geometry</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="utils.html">Utils</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="utils.config.html">Config</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.horovod.html">Horovod</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.reduce.html">Reduce</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.save.html">Saving</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.load.html">Loading</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.image.html">Image</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.depth.html">Depth</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.types.html">Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.misc.html">Misc.</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">Contact</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://tri.global">Toyota Research Institute</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/TRI-ML/packnet-sfm">PackNet-SfM GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/TRI-ML/DDAD">DDAD GitHub</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">PackNet-SfM</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="utils.html">Utils</a> &raquo;</li>
        
      <li>Logging</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/utils/utils.logging.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-packnet_sfm.utils.logging">
<span id="logging"></span><h1>Logging</h1>
<dl class="py class">
<dt id="packnet_sfm.utils.logging.AvgMeter">
<em class="property">class </em><code class="sig-prename descclassname">packnet_sfm.utils.logging.</code><code class="sig-name descname">AvgMeter</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_max</span><span class="o">=</span><span class="default_value">100</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#AvgMeter"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Average meter for logging</p>
<dl class="py method">
<dt id="packnet_sfm.utils.logging.AvgMeter.get">
<code class="sig-name descname">get</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#AvgMeter.get"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Get current average</p>
</dd></dl>

<dl class="py method">
<dt id="packnet_sfm.utils.logging.AvgMeter.get_and_reset">
<code class="sig-name descname">get_and_reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#AvgMeter.get_and_reset"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Gets current average and resets</p>
</dd></dl>

<dl class="py method">
<dt id="packnet_sfm.utils.logging.AvgMeter.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#AvgMeter.reset"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Reset meter</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="packnet_sfm.utils.logging.pcolor">
<code class="sig-prename descclassname">packnet_sfm.utils.logging.</code><code class="sig-name descname">pcolor</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">string</span></em>, <em class="sig-param"><span class="n">color</span></em>, <em class="sig-param"><span class="n">on_color</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">attrs</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#pcolor"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Produces a colored string for printing</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>string</strong> (<em>str</em>) – String that will be colored</p></li>
<li><p><strong>color</strong> (<em>str</em>) – Color to use</p></li>
<li><p><strong>on_color</strong> (<em>str</em>) – Background color to use</p></li>
<li><p><strong>attrs</strong> (<em>list of str</em>) – Different attributes for the string</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>string</strong> – Colored string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="packnet_sfm.utils.logging.prepare_dataset_prefix">
<code class="sig-prename descclassname">packnet_sfm.utils.logging.</code><code class="sig-name descname">prepare_dataset_prefix</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">config</span></em>, <em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#prepare_dataset_prefix"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Concatenates dataset path and split for metrics logging</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<em>CfgNode</em>) – Dataset configuration</p></li>
<li><p><strong>n</strong> (<em>int</em>) – Dataset index for multiple datasets</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>prefix</strong> – Dataset prefix for metrics logging</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="packnet_sfm.utils.logging.s3_url">
<code class="sig-prename descclassname">packnet_sfm.utils.logging.</code><code class="sig-name descname">s3_url</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">config</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/packnet_sfm/utils/logging.html#s3_url"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Generate the s3 url where the models will be saved</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>config</strong> (<em>CfgNode</em>) – Model configuration</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>url</strong> – String containing the URL pointing to the s3 bucket</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="utils.save.html" class="btn btn-neutral float-right" title="Saving" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="utils.reduce.html" class="btn btn-neutral float-left" title="Reduce" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2020, Toyota Research Institute (TRI)

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(false);
      });
  </script>

  
  
    
   

</body>
</html>